# Python

This folder contains:

- log_motility_data-6.py


The Results sheet generated by the CASA_RA could contain: xy coordinates (option n in the Settings tab), motion characteristics by individual sperm (option o in the Settings tab), and mean and median values for motion characteristics (option p in the Settings tab). These data could be copied or saved in order to generate a dataset. The last step is tedious and time consuming, thus we wrote a python script to automatize the procedure, which was named as “log_motility_data-6.py”.

Instructions
1.- Generate the Results sheet by running the CASA_RA.
2.- Save the Results sheet with the default name (Results.csv).
3.- Go to the working directory in the console system
4.- Call python and write the name of the script (log_motility_data-6.py) followed by the full path of the Results file (Results.csv).
5.- Write the IDs followed by a space (in our case we had four IDs: 1) Identifier of the specimen, 2) number of the video, 3) treatment and 4) time, then click enter.
When the script run by the first time it did create six new files (txt) in the working directory: 1) Motility_Results, 2) Motility_Results_Avg, 3) Motility_Results_Median, 4) Motility_Results_Sigma, 5) Motility_Results_Speed, and 6) traj.
6.- You must save a new Results sheet from the BGM plugin with the same name to re-wrote the original file; then you must run again the log_motility_data-6.py with the new IDs. The new data will be automatically added at the end of the each one of the six files previously generated. 
7.- You must repeat the step 6 with the data of each new video analyzed with the CASA_RA.


---

## Dependencies

You will require:

- - Python version 3.8.10 or later

---

## Contacts

|Name                             |Email Address           |
|---------------------------------|------------------------|
|Eder Alejandro Rodríguez Martínez|eder_rdz_mtz@hotmail.com|
|Andrés Aragón Martínez           |armandres@gmail.com.    |


